﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using DynCMS.NET.Core.Entities;
using DynCMS.NET.Core.Interfaces;

namespace DynCMS.NET.Web.Controllers
{
    public class CMSController : Controller
    {
        IDataRepository<Page> _pageRepo;

        public CMSController(IDataRepository<Page> pageRepo)
        {
            this._pageRepo = pageRepo;
        }

        //
        // GET: /CMS/

        public ActionResult Page(string pageurl)
        {
            var page = this._pageRepo.Get(new Page() { Url = pageurl });
            return View(page);
        }
    }
}